using System;

namespace WiMo.Games.Inputs
{
    public struct TouchPoint
    {
        public enum TouchLocationState
        {
            Invalid = 0,
            Released = 1,
            Pressed = 2,
            Moved = 3,
            Idle = 4,
        }

        private int _id;
        public int Id
        {
            get { return _id; }
        }

        private Vector2 _position;
        public Vector2 Position
        {
            get { return _position; }
            set { _position = value; }
        }

        private float _pressure;
        public float Pressure
        {
            get { return _pressure; }
        }

        private TouchLocationState _state;
        public TouchLocationState State
        {
            get { return _state; }
            set { _state = value; }
        }

        public TouchPoint(int id, float x, float y, float pressure, TouchLocationState state)
        {
            _id = id;
            _position = new Vector2(x, y);
            _pressure = pressure;
            _state = state;
        }

        public TouchPoint Clone()
        {
            var touchPoint = new TouchPoint();
            touchPoint._id = _id;
            touchPoint._pressure = _pressure;
            touchPoint._state = _state;
            touchPoint._position = _position.Clone();
            return touchPoint;
        }

        public override string ToString()
        {
            return string.Format("State={0} X={1} Y={2}", _state, _position.X, _position.Y);
        }
    }
}